package com.onlyphoto.onlymall.mvp.view.binder

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView

import com.onlyphoto.onlymall.R

import me.drakeet.multitype.ItemViewBinder

/**
 * Created by gaochujia on 2019-09-20.
 */
class NoMoreBinder : ItemViewBinder<String, NoMoreBinder.ViewHolder>() {

    override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): ViewHolder {
        val root = inflater.inflate(R.layout.item_footer, parent, false)
        return ViewHolder(root)
    }

    override fun onBindViewHolder(viewHolder: ViewHolder, str: String) {
        viewHolder.update(str)
    }

    class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

        var tips: TextView? = null

        init {
            tips = itemView.findViewById(R.id.tips)

        }

        fun update(str: String) {
            tips?.text = str
        }
    }
}
